package com.huang.mapper;

import com.huang.domain.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.huang.domain.SysMenu
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    @Select("SELECT\n" +
            "\tt1.*\n" +
            "FROM\n" +
            "\tsys_menu t1 LEFT\n" +
            "\tJOIN sys_role_menu t2 ON t1.menu_id = t2.menu_id\n" +
            "\tLEFT JOIN sys_user_role t3 ON t2.role_id = t3.role_id \n" +
            "WHERE\n" +
            "\tt3.user_id = #{userId}")
    List<SysMenu> loadSysUserMenus(Long userId);
}




